Add notebook that explains neural-lam pytorch tensors graph disk format#52
Add notebook that explains neural-lam pytorch tensors graph disk format#52leifdenby wants to merge 14 commits into
Conversation
|
I've cleared the notebook output, but here's a rendered file from the most recent commit leifdenby@daa5f02: Creating these plots @joeloskarsson (see end of notebook) I think what is currently implemented when saving to |
|
Adding link to comment @joeloskarsson made which I think is important here:
|
|
This should be very useful indeed! Looking at the output there seems to a bug yes. It could very well be the label sorting that's missing, that you linked to as fixed in #34. Have you tried rebasing this on top of that PR and see if you have the same issue? |
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "`neural-lam` expects the _subgraphs_ that are individually used for subsequent message passing operations to be saved separately. For the Keisler graph, this means that we need to split the graph into subgraphs that do the mesh-to-grid (`m2g`), mesh-to-mesh (`m2m`), grid-to-mesh (`g2m`), and grid-to-grid (`g2g`) operations. In `weather-model-graphs` edges have a `component` attribute that indicates which of these operations they belong to, so we can use this to split the graph." |
There was a problem hiding this comment.
grid-to-grid? What would that be? I think this is mentioned at other places in the notebook as well, but maybe just a typo.
There was a problem hiding this comment.
yes, that was a typo 😳 thanks for catching this!
Co-authored-by: Joel Oskarsson <joel.oskarsson@outlook.com>
No, I will try that and see :) thanks |
…into doc/neural-lam-graphs
…weather-model-graphs into doc/neural-lam-graphs
|
Now that #34 is in The edges in the loaded files (neural-lam pickled pytorch tensor files) was previously: And here the edges from the So I think there is still something going wrong since the mesh indexes for the I think a bit more digging is needed here... I've included the cell outputs in the notebook in the most recent commit (a7a8e9e). |
|
Ok, I think that maybe we viewed different things as wrong. Or maybe I just did not pay close enough attention. I was mostly worried that not all mesh nodes seemed to be part of an edge in g2m. But maybe that was just how you set up the graph? If I understand you correctly, you view the problem as m2m being saved with the first mesh node having index 0 in |
…into doc/neural-lam-graphs
I had expected that the node-indices in the tensors saved to disk would be globally unique integers. Rereading what you've written here makes me realise we should document as part of the spec in mllam/neural-lam#323 the node-index values in the adjacency-list tensors and how they relate to the indices of the feature tensors (in effect what we are discussing here: mllam/neural-lam#323 (comment)) I think it would make most sense if the way we reference nodes in the |



Describe your changes
Add notebook that describes the current
neural-lampickled pytorch tensors graph disk format. I feel like this documentation is currently missing, and since we write to this format inweather-model-graphsI think this would be a place where we could document it. This documentation could maybe also exist withinneural-lamitself. But I feel like having this notebook could be a starting point at least.NOTE: The notebook also shows that there is currently a bug in the index ordering in adjacency lists stored into pickle pytorch Tensors.
No change of dependencies needed.
Issue Link
n/a
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee